package com.wk.webview.autoserviceimpl

import android.content.Context
import android.content.Intent
import com.google.auto.service.AutoService
import com.wk.common.autoservice.IWebViewService
import com.wk.webview.activity.WebViewActivity
import com.wk.webview.utils.Constants

@AutoService(IWebViewService::class)
class WebViewServiceImpl : IWebViewService {
    override fun openWebView(context: Context, url: String, title: String, showActionBar: Boolean) {
        val intent = Intent(context, WebViewActivity::class.java)
        intent.putExtra(Constants.WEB_VIEW_TITLE, title)
        intent.putExtra(Constants.WEB_VIEW_URL, url)
        intent.putExtra(Constants.WEB_VIEW_SHOW_ACTIONBAR, showActionBar)
        context.startActivity(intent)
    }
}